package GameOfLife;

/**
 * The Position of a Cell
 * 
 * @see Cell
 */

public class Position {
	
	/**
	 * X position
	 */
	private int x;
	
	/**
	 * Y position
	 */
	private int y;
	
	public Position(){}
	
	/**
	 * Constructor used to create a Position
	 * 
	 * @param X position 
	 * @param Y position
	 */
	public Position(int x, int y){	
		this.x = x;
		this.y = y;
	}

	/**
	 * equals method to see if a position is the same that obj's
	 * 
	 * @param obj which is compared to this
	 * 
	 * @return true if this equals to obj
	 */
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Position other = (Position) obj;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}
	
	public int getX() {
		return this.x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public void setX(int x) {
		this.x = x;
	}
	
	
	public String toString(){
		return "("+this.x+","+this.y+")";
	}
	

}
